import { editUser } from "@/api/modules/user";
import { GlobalStore } from "@/stores";
import { showTips } from "@/utils/util";
export const changeUserInfo = async (fieldKey: string, value: any) => {
	const globalStore = GlobalStore();
	let param: any = { id: globalStore.userInfo.userId };
	param[fieldKey] = value;
	let { code } = await editUser(param);
	let ok = showTips(code, "操作");
	if (ok) {
		globalStore.userInfo[fieldKey] = value;
	}
	return ok;
};
